package com.youi.shop.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>
 * 订单项表
 * </p>
 *
 * @author xxf
 * @since 2020-11-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tb_order_item")
@ApiModel(value="OrderItem对象", description="订单项表")
public class OrderItem implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单项主键")
    @TableId(value = "order_item_id", type = IdType.AUTO)
    private Long orderItemId;

    @ApiModelProperty(value = "订单主键")
    @TableField("order_id")
    private Long orderId;

    @ApiModelProperty(value = "商品主键")
    @TableField("product_id")
    private Long productId;

//    @ApiModelProperty(value = "商品分类id")
//    @TableField("product_category_id")
//    private Long productCategoryId;

    @ApiModelProperty(value = "购买数量")
    @TableField("quantity")
    private Integer quantity;

    @ApiModelProperty(value = "订单项小计")
    @TableField("count")
    private BigDecimal count;

    @TableField(exist = false)
    private Product product;

}
